package com.tecode.controller;

import com.tecode.bean.FavotiteMusic;
import com.tecode.service.FavoriteMusicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * Created by Administrator on 2019/4/12.
 */
@Controller
public class FavoriteMusicController {
    @Autowired
    private FavoriteMusicService favoriteMusicService;

    /**
     * 从收藏列表中移除指定歌曲
     * @param musicId
     * @param favoriteId
     * @return
     */
    @DeleteMapping("delMusicFromFavorite")
    @ResponseBody
    public boolean delMusicFromFavorite(@RequestParam Integer musicId,@RequestParam Integer favoriteId){
        int i = favoriteMusicService.delMusicFromFavorite(musicId,favoriteId);
        return i > 0 ? true : false;
    }
}
